<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: pulse_audio_io.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">pulse_audio_io.h</div>  </div>
</div>
<div class="contents">
<a href="pulse__audio__io_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __PULSE_AUDIO_IO_H__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __PULSE_AUDIO_IO_H__ 1</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="sample__io_8h.html">sample_io.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;pulse/simple.h&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a><a class="code" href="classCPulseAudioIO.html">00008</a> <span class="keyword">class </span><a class="code" href="classCPulseAudioIO.html">CPulseAudioIO</a> : <span class="keyword">public</span> <a class="code" href="classISampleIO.html">ISampleIO</a>
<a name="l00009"></a>00009 {
<a name="l00010"></a>00010 <span class="keyword">public</span>:
<a name="l00011"></a>00011         <span class="comment">// for capture</span>
<a name="l00012"></a>00012         <a class="code" href="classCPulseAudioIO.html#ab24c6486ad984144bcf9dc87186ce77d">CPulseAudioIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pChannels);
<a name="l00013"></a>00013 
<a name="l00014"></a>00014         <span class="comment">// for playback</span>
<a name="l00015"></a>00015         <a class="code" href="classCPulseAudioIO.html#ab24c6486ad984144bcf9dc87186ce77d">CPulseAudioIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction,
<a name="l00016"></a>00016                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pChannels,
<a name="l00017"></a>00017                         <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> pStreamInfo);
<a name="l00018"></a>00018 
<a name="l00019"></a>00019         <span class="comment">// for capture and playback</span>
<a name="l00020"></a>00020         <a class="code" href="classCPulseAudioIO.html#ab24c6486ad984144bcf9dc87186ce77d">CPulseAudioIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction);
<a name="l00021"></a>00021 
<a name="l00022"></a>00022         <span class="keyword">virtual</span> <a class="code" href="classCPulseAudioIO.html#ad6dce07cb44567eaf842d69ab3f56300">~CPulseAudioIO</a>();
<a name="l00023"></a>00023 
<a name="l00024"></a>00024         <span class="comment">/* START methods inherited by ISampleIO */</span>
<a name="l00025"></a>00025         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a97ada1fd9b0e5e36344699ece7ab912d">init</a>(<a class="code" href="properties__reader_8h.html#a67847fd00cb49d80dd45f61722eb9a43">CPropertiesReader</a> *pConfig);
<a name="l00026"></a>00026         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a41f9f94d6940a71fde5ce02496352a27">destroy</a>();
<a name="l00027"></a>00027 
<a name="l00028"></a>00028         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a53f27db815744617a085f466693763ed">read</a>(<span class="keywordtype">void</span>** pData, <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pTimeout = 1000);
<a name="l00029"></a>00029         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#aaadbf39f26d049651660973359ed9d31">write</a>(<span class="keywordtype">void</span>* pData, <span class="keyword">const</span> <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pLength);
<a name="l00030"></a>00030 
<a name="l00031"></a>00031         <span class="keyword">virtual</span> <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> <a class="code" href="classCPulseAudioIO.html#aca9462dd9658c52e384d312606559a8d">getStreamInfo</a>();
<a name="l00032"></a>00032         <span class="comment">/* END methods inherited by ISampleIO */</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">private</span>:
<a name="l00035"></a><a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24e">00035</a>         <span class="keyword">enum</span> <a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24e">EInitError</a> {
<a name="l00036"></a><a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24eacbdf5e234b007e77a2336265232b9db6">00036</a>                 <a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24eacbdf5e234b007e77a2336265232b9db6">INIT_NO_ERROR</a>          = 0,
<a name="l00037"></a>00037 
<a name="l00038"></a>00038                 <span class="comment">// errors</span>
<a name="l00039"></a><a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24eab8b38c7cdb04cfb8d7aa1758bb2c2f69">00039</a>                 <a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24eab8b38c7cdb04cfb8d7aa1758bb2c2f69">INIT_FAILURE</a>           = 1,
<a name="l00040"></a><a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24ea84b61e26516caaf4bb8b0b6958341572">00040</a>                 <a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24ea84b61e26516caaf4bb8b0b6958341572">INIT_CAPTURE_ERROR</a>     = 2,
<a name="l00041"></a><a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24eaea14a43be6e74cadf63111c72cace28f">00041</a>                 <a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24eaea14a43be6e74cadf63111c72cace28f">INIT_PLAYBACK_ERROR</a>    = 3,
<a name="l00042"></a>00042         };
<a name="l00043"></a>00043 
<a name="l00044"></a><a class="code" href="classCPulseAudioIO.html#ad7cffabc03bbc6c71b0b9cbd7e59e8e2">00044</a>         <a class="code" href="classCPulseAudioIO.html#a36e568f989dec5ee9ec49983f3c1f24e">EInitError</a> <a class="code" href="classCPulseAudioIO.html#ad7cffabc03bbc6c71b0b9cbd7e59e8e2">mError</a>;
<a name="l00045"></a><a class="code" href="classCPulseAudioIO.html#a68b4534614245107afe37dd8fadb6bf2">00045</a>         <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> <a class="code" href="classCPulseAudioIO.html#a68b4534614245107afe37dd8fadb6bf2">mAction</a>;
<a name="l00046"></a>00046 
<a name="l00047"></a><a class="code" href="classCPulseAudioIO.html#a6925cb7f0e52cd1d4fc3fb562d909e52">00047</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a6925cb7f0e52cd1d4fc3fb562d909e52">mPlaybackChannels</a>;
<a name="l00048"></a><a class="code" href="classCPulseAudioIO.html#acc6b4fbe405b9a513ee0efef0f864e2f">00048</a>         pa_simple *<a class="code" href="classCPulseAudioIO.html#acc6b4fbe405b9a513ee0efef0f864e2f">mPlaybackHandle</a>;
<a name="l00049"></a>00049 
<a name="l00050"></a><a class="code" href="classCPulseAudioIO.html#a8467595676e4ffa0fd84a8de7687b1b0">00050</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a8467595676e4ffa0fd84a8de7687b1b0">mCaptureChannels</a>;
<a name="l00051"></a><a class="code" href="classCPulseAudioIO.html#a476360509aac6aca6f534accbd3e5d4b">00051</a>         pa_simple *<a class="code" href="classCPulseAudioIO.html#a476360509aac6aca6f534accbd3e5d4b">mCaptureHandle</a>;
<a name="l00052"></a><a class="code" href="classCPulseAudioIO.html#a55b5e65d0e69b684ab6b2751afc4167c">00052</a>         <span class="keywordtype">char</span> *<a class="code" href="classCPulseAudioIO.html#a55b5e65d0e69b684ab6b2751afc4167c">mCaptureBuffer</a>;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 
<a name="l00055"></a><a class="code" href="classCPulseAudioIO.html#aeed876c7ab0e2e622964b825264e5619">00055</a>         <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> <a class="code" href="classCPulseAudioIO.html#aeed876c7ab0e2e622964b825264e5619">mStreamInfo</a>;
<a name="l00056"></a><a class="code" href="classCPulseAudioIO.html#a61853857bbd1a6bb31251f90f44b16c2">00056</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a61853857bbd1a6bb31251f90f44b16c2">mBytePerSample</a>;
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="classCPulseAudioIO.html#abd6031729829df6ef5fdea13f6612be2">00058</a>         <span class="keywordtype">bool</span> <a class="code" href="classCPulseAudioIO.html#abd6031729829df6ef5fdea13f6612be2">mDoPlayback</a>;
<a name="l00059"></a><a class="code" href="classCPulseAudioIO.html#af7d3fbd218e4819dc65579328f80335c">00059</a>         <span class="keywordtype">bool</span> <a class="code" href="classCPulseAudioIO.html#af7d3fbd218e4819dc65579328f80335c">mDoCapture</a>;
<a name="l00060"></a><a class="code" href="classCPulseAudioIO.html#a037c18f76fe11bf5c741eefafb71af53">00060</a>         <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classCPulseAudioIO.html#a037c18f76fe11bf5c741eefafb71af53">mCaptureSource</a>;
<a name="l00061"></a><a class="code" href="classCPulseAudioIO.html#afbe2c62f1f8693deb97d56444529e5da">00061</a>         <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classCPulseAudioIO.html#afbe2c62f1f8693deb97d56444529e5da">mPlaybackSink</a>;
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 
<a name="l00064"></a>00064         <a class="code" href="classCPulseAudioIO.html#ab24c6486ad984144bcf9dc87186ce77d">CPulseAudioIO</a>(<span class="keyword">const</span> <a class="code" href="classCPulseAudioIO.html">CPulseAudioIO</a>&amp; );
<a name="l00065"></a>00065         <a class="code" href="classCPulseAudioIO.html">CPulseAudioIO</a>&amp; <a class="code" href="classCPulseAudioIO.html#a0d802a47c61411acb8fb351da56eb959">operator=</a>(<span class="keyword">const</span> <a class="code" href="classCPulseAudioIO.html">CPulseAudioIO</a>&amp; );
<a name="l00066"></a>00066 
<a name="l00067"></a>00067         <span class="keywordtype">bool</span> <a class="code" href="classCPulseAudioIO.html#a89ccafd6befb04a2c5eb0fd4d9759aad">initPlayback</a>();
<a name="l00068"></a>00068         <span class="keywordtype">bool</span> <a class="code" href="classCPulseAudioIO.html#a3e44d30d8d8c2cf456e2d3c51ac92b66">initCapture</a>();
<a name="l00069"></a>00069         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPulseAudioIO.html#a0517bc1d6bc43e0b80eeafbb806be42c">getBytePerSample</a>();
<a name="l00070"></a>00070 
<a name="l00083"></a>00083         <span class="keywordtype">bool</span> <a class="code" href="classCPulseAudioIO.html#ac6f486fc8d06afc078acdd756be90c44">getPASampleSpecsFromStreamInfo</a>(pa_sample_spec &amp;pSampleSpec,
<a name="l00084"></a>00084                         <span class="keywordtype">bool</span> pForCapture);
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 
<a name="l00087"></a><a class="code" href="classCPulseAudioIO.html#a6d2d16c1ca671017a7029403cca4c115">00087</a>         <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="classCPulseAudioIO.html#a6d2d16c1ca671017a7029403cca4c115">sIniSectionName</a>;
<a name="l00088"></a><a class="code" href="classCPulseAudioIO.html#af15ca89d1bcef2c6d9e2d75211a84b30">00088</a>         <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="classCPulseAudioIO.html#af15ca89d1bcef2c6d9e2d75211a84b30">sConfPlaybackSink</a>;
<a name="l00089"></a><a class="code" href="classCPulseAudioIO.html#a62de8cacc98e09140cc329c0ba7e0996">00089</a>         <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="classCPulseAudioIO.html#a62de8cacc98e09140cc329c0ba7e0996">sConfCaptureSource</a>;
<a name="l00090"></a>00090 };
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="preprocessor">#endif </span><span class="comment">/* __PULSE_AUDIO_IO_H__ */</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:39 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
